// =====================================================================================
// 
//       Filename:  main.cpp
// 
//    Description:  
// 
//        Version:  0.1
//        Created:  06/19/2012 17:11:58 PM
//       Revision:  none
//       Compiler:  g++
// 
//         Author:  zhengle, le.zheng@taodinet.com
//        Company:  Hangzhou TaodiNet Ltd.
// 
// =====================================================================================

// #####   HEADER FILE INCLUDES   ###################################################
//#include    "trader.h"
#include    "ftd.h"
#include    "mem.h"
#include    "utils.h"
#include    "logger.h"
//#include    "types.h"
#include    "json/json.h"

#include    <string.h>
#include    <cstdlib>
#include    <fstream>
#include    <iomanip>
#include    <iostream>
#include    <string>

#include "ThreadPool.h"

#include "RingBuf.h"


using namespace std;

int test_process(int argc, char **argv);

void ctrlcHandle(int signum)
{
	debug_output("ctrl-c signal .....\n");
}

// ===  FUNCTION  ======================================================================
//         Name:  main
//  Description:  main function
// =====================================================================================
int main(int argc, char **argv)
{
	//return test_process(argc, argv);

	
	CThreadPool* m_threadPool = new CThreadPool(1);
	if(m_threadPool ==NULL)
	{
		printf("threadPool new failed\n");
		return -1;
	}
	m_threadPool->Bind(8805);

	debug_output("%s\n" , __PRETTY_FUNCTION__);
	struct sigaction act;
	act.sa_handler = ctrlcHandle;   
	sigemptyset(&act.sa_mask);
	act.sa_flags = 0;
	sigaction(SIGINT , &act , NULL);			
	signal(SIGPIPE, SIG_IGN);

	sleep(-1);
	return 0;
}        // ----------  end of function main  ---------- 

